package 剑指offer;

import javax.swing.tree.TreeNode;
import java.util.*;

/**
 * @ClassName _32_III_从上到下打印二叉树
 * @Description TODO
 * @Author 昝亚杰
 * @Date 2022/3/1 21:38
 * Version 1.0
 **/
public class _32_III_从上到下打印二叉树 {
    /*public List<List<Integer>> levelOrder(TreeNode root) {
        Queue<TreeNode> queue = new LinkedList();
        List<List<Integer>> res = new ArrayList<>();
        if(root != null){
            queue.add(root);
        }
        while(!queue.isEmpty()){
            LinkedList<Integer> list = new LinkedList<>();
            for(int i = queue.size(); i > 0; i--){
                TreeNode now = queue.poll();
                if(res.size() % 2 == 0){
                    list.addLast(now.val);
                }else{
                    list.addFirst(now.val);
                }
                if(now.left != null){
                    queue.add(now.left);
                }
                if(now.right != null){
                    queue.add(now.right);
                }
            }
            res.add(list);
        }
        return res;
    }*/
}
